const express=require('express');
const cookieParser=require('cookie-parser');

let server=express();
server.listen(8080);

server.use(cookieParser('456789789'));

server.get('/',(req,res)=>{
    console.log(req.cookies)          //加签名前
    console.log('signed:',req.signedCookies)    //加签名后

    // cookie（name,value,options）
    res.cookie('pass',456789,{
        //domain 
        //expires:date 日期对象
        //maxAge:int   毫秒
        //path    
        //secure:true  只用于https  
        signed:true     //是否设置签名

    })
    res.end();


})